<template>
    <div style="margin:0 3rem;padding-bottom:6.4rem">
        <!-- A -->
        <div class="topPies">
            <div class="pie_title">A.基础信息(单选)</div>
            <div class="pies_box">

                <div class="pie_item">
                    <div class="pie_item_title">{{dataA1.subject_name}}</div>
                    <div class="pie">
                        <pieOne :peopleN="dataA1.answer_people" :data="dataA1.subject"></pieOne>
                    </div>
                </div>
                <div class="pie_item">
                    <div class="pie_item_title">{{dataA2.subject_name}}</div>
                    <div class="pie">
                        <pieTwo :peopleN="dataA2.answer_people" :data="dataA2.subject"></pieTwo>
                    </div>
                </div>
                <div class="pie_item">
                    <div class="pie_item_title">{{dataA3.subject_name}}</div>
                    <div class="pie">
                        <pieThree :peopleN="dataA3.answer_people" :data="dataA3.subject"></pieThree>
                    </div>
                </div>
            </div>
        </div>
        <!-- B -->
        <div class="bContent">
            <div class="pie_title">B.公路养护安全满意度评价<span>（工程养护部）</span></div>
            <div class="pies_box">
                <div class="pie_item">
                    <div class="pie_item_title">{{ dataB1.subject_name }}</div>
                    <div class="content">
                        <!-- 横线 -->
                        <div class="transverse_line">
                            <crossBar :data="dataB1.subject" :peopleN="dataB1.answer_people"></crossBar>
                        </div>
                        <!-- 一般 -->
                        <div class="chartsBar">
                            <div class="chartsBar_item">
                                <yiBanBar v-if="dataB1?.subject" :data="dataB1?.subject[1]?.option"></yiBanBar>
                            </div>
                            <div class="chartsBar_item">
                                <bumanyiBar v-if="dataB1?.subject" :data="dataB1?.subject[2]?.option"></bumanyiBar>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="pie_item">
                    <div class="pie_item_title">{{ dataB2.subject_name }}</div>
                    <div class="content">
                        <!-- 横线 -->
                        <div class="transverse_line">
                            <crossBar :data="dataB2.subject" :peopleN="dataB2.answer_people"></crossBar>
                        </div>
                        <!-- 一般 -->
                        <div class="chartsBar">
                            <div class="chartsBar_item">
                                <yiBanBar v-if="dataB2?.subject" :data="dataB2?.subject[1]?.option"></yiBanBar>
                            </div>
                            <div class="chartsBar_item">
                                <bumanyiBar v-if="dataB2?.subject" :data="dataB2?.subject[2]?.option"></bumanyiBar>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="pie_item">
                    <div class="pie_item_title">{{ dataB3.subject_name }}</div>
                    <div class="content">
                        <!-- 横线 -->
                        <div class="transverse_line">
                            <crossBar :data="dataB3.subject" :peopleN="dataB3.answer_people"></crossBar>
                        </div>
                        <!-- 一般 -->
                        <div class="chartsBar">
                            <div class="chartsBar_item">
                                <yiBanBar v-if="dataB3?.subject" :data="dataB3?.subject[1]?.option"></yiBanBar>
                            </div>
                            <div class="chartsBar_item">
                                <bumanyiBar v-if="dataB3?.subject" :data="dataB3?.subject[2]?.option"></bumanyiBar>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- C -->
        <div class="bContent">
            <div class="pie_title">C.收费站服务满意度评价<span>（收费部）</span></div>
            <div class="pies_box">
                <div class="pie_item">
                    <div class="pie_item_title">{{ dataC1.subject_name }}</div>
                    <div class="content">
                        <!-- 横线 -->
                        <div class="transverse_line">
                            <crossBar :data="dataC1.subject" :peopleN="dataC1.answer_people"></crossBar>
                        </div>
                        <!-- 一般 -->
                        <div class="chartsBar">
                            <div class="chartsBar_item">
                                <yiBanBar v-if="dataC1?.subject" :data="dataC1?.subject[1]?.option"></yiBanBar>
                            </div>
                            <div class="chartsBar_item">
                                <bumanyiBar v-if="dataC1?.subject" :data="dataC1?.subject[2]?.option"></bumanyiBar>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="pie_item">
                    <div class="pie_item_title">{{ dataC2.subject_name }}</div>
                    <div class="content">
                        <!-- 横线 -->
                        <div class="transverse_line">
                            <crossBar :data="dataC2.subject" :peopleN="dataC2.answer_people"></crossBar>
                        </div>
                        <!-- 一般 -->
                        <div class="chartsBar">
                            <div class="chartsBar_item">
                                <yiBanBar v-if="dataC2?.subject" :data="dataC2?.subject[1]?.option"></yiBanBar>
                            </div>
                            <div class="chartsBar_item">
                                <bumanyiBar v-if="dataC2?.subject" :data="dataC2?.subject[2]?.option"></bumanyiBar>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="pie_item">
                    <div class="pie_item_title">{{ dataC3.subject_name }}</div>
                    <div class="content">
                        <!-- 横线 -->
                        <div class="transverse_line">
                            <crossBar :data="dataC3.subject" :peopleN="dataC3.answer_people"></crossBar>
                        </div>
                        <!-- 一般 -->
                        <div class="chartsBar">
                            <div class="chartsBar_item">
                                <yiBanBar v-if="dataC3?.subject" :data="dataC3?.subject[1]?.option"></yiBanBar>
                            </div>
                            <div class="chartsBar_item">
                                <bumanyiBar v-if="dataC3?.subject" :data="dataC3?.subject[2]?.option"></bumanyiBar>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="d_e_box">
            <!-- D -->
            <div class="d">
                <div class="pie_title">D.车辆救援服务满意度评价<span>（安监部）</span></div>
                <div class="d_pies_box">
                    <div class="pie_item_title">{{ dataD1.subject_name  }}</div>
                    <div class="content">
                        <!-- 横线 -->
                        <div class="transverse_line">
                            <crossBar :data="dataD1.subject" :peopleN="dataD1.answer_people"></crossBar>
                        </div>
                        <!-- 一般 -->
                        <div class="chartsBar">
                            <div class="chartsBar_item">
                                <yiBanBar v-if="dataD1?.subject" :data="dataD1?.subject[1]?.option"></yiBanBar>
                            </div>
                            <div class="chartsBar_item">
                                <bumanyiBar v-if="dataD1?.subject" :data="dataD1?.subject[2]?.option"></bumanyiBar>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- E -->
            <div class="e">
                <div class="e_pie_item">
                    <div class="pie_title">E.客户服务满意度评价<span>（路网信息中心）</span></div>
                    <div class="e_pies_box">
                        <div class="pie_item_title">{{ dataE1.subject_name  }}</div>
                        <div class="content">
                            <!-- 横线 -->
                            <div class="transverse_line">
                                <crossBar :data="dataE1.subject" :peopleN="dataE1.answer_people"></crossBar>
                            </div>
                            <!-- 一般 -->
                            <div class="chartsBar">
                                <div class="chartsBar_item">
                                    <yiBanBar v-if="dataE1?.subject" :data="dataE1?.subject[1]?.option"></yiBanBar>
                                </div>
                                <div class="chartsBar_item">
                                    <bumanyiBar v-if="dataE1?.subject" :data="dataE1?.subject[2]?.option"></bumanyiBar>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="e_pie_item">
                    <div class="pie_title" style="margin-top:2rem"></div>
                    <div class="e_pies_box">
                        <div class="pie_item_title">{{ dataE2.subject_name  }}</div>
                        <div class="content">
                            <!-- 横线 -->
                            <div class="transverse_line">
                                <crossBar :data="dataE2.subject" :peopleN="dataE2.answer_people"></crossBar>
                            </div>
                            <!-- 一般 -->
                            <div class="chartsBar">
                                <div class="chartsBar_item">
                                    <yiBanBar v-if="dataE2?.subject" :data="dataE2?.subject[1]?.option"></yiBanBar>
                                </div>
                                <div class="chartsBar_item">
                                    <bumanyiBar v-if="dataE2?.subject" :data="dataE2?.subject[2]?.option"></bumanyiBar>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- F -->
        <div class="f">
            <div class="pie_title">F.运营品牌满意度评价<span>（收费部）</span>
            </div>
            <div class="f_content">
                <div class="f_item">
                    <div class="f_item_title">{{ dataF1.subject_name }}</div>
                    <div class="crossBarClass">
                        <crossBar :data="dataF1.subject" :peopleN="dataF1.answer_people"></crossBar>
                    </div>
                </div>
                <div class="f_item">
                    <div class="f_item_title">{{ dataF2.subject_name }}</div>
                    <div class="crossBarClass">
                        <crossBar :data="dataF2.subject" :peopleN="dataF2.answer_people"></crossBar>
                    </div>
                </div>
            </div>
        </div>
        <!-- 意见建议(柱形图)-->
        <div class="opinion" v-if="data2.zhuzhuangtu">
            <opinion :data="data2.zhuzhuangtu" :name="data2.name" :baifenbi="data2.baifenbi"></opinion>
        </div>

        <!-- 雷达图 -->
        <div class="radar">
            <div class="radar_item" v-if="data2.leidatu1">
                <div class="radar_item_title">
                    <div>30次以上工单统计</div>
                    <div>参与总人数:{{data2.leidatu1?.total_user}}人</div>
                </div>
                <radar :dataS="data2.leidatu1" :lv="data2.lv"></radar>
            </div>
            <div class="radar_item" v-if="data2.leidatu2">
                <div class="radar_item_title">
                    <div>货车司机分析图</div>
                    <div>参与总人数:{{data2.leidatu2?.total_user}}人</div>
                </div>
                <radar :dataS="data2.leidatu2" :lv="data2.lv2"></radar>
            </div>
        </div>
    </div>
</template>

<script>
import { post } from "@/assets/js/http.js"
export default {
    components: {
        "pieOne": () => import("@/components/comEcharts/pieOne.vue"),
        "pieTwo": () => import("@/components/comEcharts/pieTwo.vue"),
        "pieThree": () => import("@/components/comEcharts/pieThree.vue"),
        "crossBar": () => import("@/components/comEcharts/crossBar.vue"),
        "yiBanBar": () => import("@/components/comEcharts/yiBanBar.vue"),
        "bumanyiBar": () => import("@/components/comEcharts/bumanyiBar.vue"),
        "opinion": () => import("@/components/comEcharts/opinion.vue"),
        "radar": () => import("@/components/comEcharts/radar.vue"),
    },
    data() {
        return {
            dataA1: [],
            dataA2: [],
            dataA3: [],
            dataB1: [],
            dataB2: [],
            dataB3: [],
            dataC1: [],
            dataC2: [],
            dataC3: [],
            dataD1: [],
            dataE1: [],
            dataE2: [],
            dataF1: [],
            dataF2: [],
            data2: {},
        }
    },
    methods: {
        getInit() {
            this.getdataA1()
            this.getdataA2()
            this.getdataA3()
            this.getdataB1()
            this.getdataB2()
            this.getdataB3()
            this.getdataC1()
            this.getdataC2()
            this.getdataC3()
            this.getdataD1()
            this.getdataE1()
            this.getdataE2()
            this.getdataF1()
            this.getdataF2()
            this.getData2()
        },
        getdataA1() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 1,
                    subject_id: 1
                },
                loading: true
            }).then(res => {
                this.dataA1 = res
            })
        },
        getdataA2() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 1,
                    subject_id: 2
                }
            }).then(res => {
                this.dataA2 = res
            })
        },
        getdataA3() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 1,
                    subject_id: 3
                }
            }).then(res => {
                this.dataA3 = res
            })
        },
        getdataB1() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 2,
                    subject_id: 4
                }
            }).then(res => {
                this.dataB1 = res
            })
        },
        getdataB2() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 2,
                    subject_id: 5
                }
            }).then(res => {
                this.dataB2 = res
            })
        },
        getdataB3() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 2,
                    subject_id: 6
                }
            }).then(res => {
                this.dataB3 = res

            })
        },
        getdataC1() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 3,
                    subject_id: 7
                }
            }).then(res => {
                this.dataC1 = res
            })
        },
        getdataC2() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 3,
                    subject_id: 8
                }
            }).then(res => {
                this.dataC2 = res
            })
        },
        getdataC3() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 3,
                    subject_id: 9
                }
            }).then(res => {
                this.dataC3 = res

            })
        },
        getdataD1() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 4,
                    subject_id: 10
                }
            }).then(res => {
                this.dataD1 = res
            })
        },
        getdataE1() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 5,
                    subject_id: 11
                }
            }).then(res => {
                this.dataE1 = res

            })
        },
        getdataE2() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 5,
                    subject_id: 12
                }
            }).then(res => {
                this.dataE2 = res

            })
        },
        getdataF1() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 6,
                    subject_id: 13
                }
            }).then(res => {
                this.dataF1 = res
            })
        },
        getdataF2() {
            post({
                url: "/admin/answer.Subject/subject_census",
                data: {
                    cate_id: 6,
                    subject_id: 14
                }
            }).then(res => {
                this.dataF2 = res

            })
        },
        getData2() {
            post({
                url: "/admin/answer.Subject/work_order_census"
            }).then(res => {
                this.data2 = res
            })
        }
    },
    mounted() {
        this.getInit()
    }
}
</script>

<style  scoped>
.topPies {
    width: 100%;
    height: 42.7rem;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 14px 11px;
    box-sizing: border-box;
    margin-top: 17px;
    display: flex;
    flex-direction: column;
}
.pie_title {
    font-size: 2rem;
    font-family: Source Han Sans CN;
    font-weight: bold;
    color: #222222;
    line-height: 1em;
}
.pie_title span {
    color: #fe3c1c !important;
}
.pies_box {
    display: flex;
    width: 100%;
    height: 100%;
    margin-top: 2rem;
}
.pie_item {
    width: calc(100% / 3);
    padding-right: 4rem;

    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}
.pie_item_title {
    font-size: 2rem;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #222222;
    margin-left: 11px;
    line-height: 1em;
    flex-shrink: 0;
}
.pie {
    width: 100%;
    height: 100%;
}
.bContent {
    width: 100%;
    height: 83.9rem;
    margin-top: 17px;
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 14px 12px;
    box-sizing: border-box;
}
.content {
    padding-top: 50px;
    padding-left: 12px;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.transverse_line {
}
.chartsBar {
    width: 100%;
    height: 88%;
    padding-top: 5rem;
}
.chartsBar_item {
    height: 50%;
    width: 100%;
}
.d_e_box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 83.9rem;
}
.d {
    width: calc(100% / 3);
    height: 83.9rem;
    margin-top: 17px;
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 14px 12px;
    box-sizing: border-box;
    flex-shrink: 0;
}
.d_pies_box {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    margin-top: 2rem;
}
.e {
    width: calc((100% / 3) + (100% / 3) - 1.7rem);
    margin-left: 1.7rem;
    height: 83.9rem;
    margin-top: 17px;
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 14px 12px;
    box-sizing: border-box;
    display: flex;
}
.e_pie_item {
    width: calc(100% / 2);
    padding-right: 4rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}
.e_pies_box {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    margin-top: 2rem;
}

.f {
    width: 100%;
    height: 22.2rem;
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 1.4rem 2.6rem 1.9rem;
    box-sizing: border-box;
    margin-top: 17px;
}
.f_content {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 0 10rem;
}
.f_item {
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
    box-sizing: border-box;
}
.f_item_title {
    font-size: 2rem;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: #222222;
    text-align: center;
}
.crossBarClass {
    width: 100%;
    padding: 2rem 13rem 0 13rem;
}
.opinion {
    width: 100%;
    height: 44.4rem;
    margin-top: 1.7rem;
    background: #fff;
    display: flex;
}
.radar {
    width: 100%;
    height: 50rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0 1.7rem;
    margin-top: 1.7rem;
}
.radar_item {
    width: 50%;
    height: 100%;
    background: #fff;
    padding: 1.4rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.radar_item_title {
    font-size: 2rem;
    font-family: Source Han Sans CN;
    font-weight: 500;
    color: #222222;
    position: relative;
}

.radar_item_title div:last-child {
    font-size: 1.6rem;
    position: absolute;
    bottom: -3rem;
    font-weight: 400;
}
</style>